﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using System.Data.EntityModel;
using System.Data.Objects;
using System.Data.Objects.DataClasses;
using System.Data.EntityClient;
using KandaAlpha.Domain.Model.Entities;

namespace KandaAlpha.Infrastructure.Repository.EF
{
    public class KandaAlphaContext : ObjectContext
    {
        public KandaAlphaContext() : base("name=KandaAlphaEntities", "KandaAlphaEntities")
        {
            _customers = CreateObjectSet<Customer>();
            _orders = CreateObjectSet<Order>();
            base.ContextOptions.DeferredLoadingEnabled = true; // lazy loading
        }

        private ObjectSet<Customer> _customers;
        private ObjectSet<Order> _orders;

        public ObjectSet<Customer> Customers
        {get {return _customers;}}

        public ObjectSet<Order> Orders
        {get{return _orders;}}
        
    }
}
